<%@ page contentType="text/html;charset=GBK" %>
<%@ page import="java.util.*" %>
<%@ page import="com.ionglobal.db.*" %>
<%@ page import="com.ionglobal.lib.*" %>
<%@ page import="com.ionglobal.cms.*" %>
<%@ page import="com.ionglobal.misc.*" %>

<%@ include file="db_include.jsp" %>

<%
	Vector vc;
	String str="";
	ItemData ca;
	
	try {	
		Sysop sysop=(Sysop)session.getAttribute("sysop");
		if ( sysop==null)
		{
			response.sendRedirect("index.jsp");
		 	return;
		 }
			
		long t1=System.currentTimeMillis();	
		vc=ModuleTree.getFullTree(dbi,0,sysop.getId(),session,"tree");
		long t2=System.currentTimeMillis()-t1;
		
		if ( vc.size()<1) return ;
		for (int i=1;i<vc.size();i++)
		{		
				ca=(ItemData)vc.get(i);
				str="itemObject_array["+String.valueOf(i-1)+"]=new itemObject(";
				str+=ca.id+",'"+Utilities.strReplace(ca.name,"'","\\'")+"',"+ca.index+","+ca.layer+","+ca.isLeaf+","+ca.isLastChild+","+"false,"+ca.haveLink+",'"+ca.linkUrl +"');" ;
				out.println(str);
		}		
	}catch (Exception e)
	{
		out.println(e);
	}finally
	{
		dbi.closeAll();	
	}
%>
